package minidb.index;

import minidb.buffer.Buffer;
import minidb.record.RID;
import static minidb.type.Const.*;

public class Node {
	private int pageNum;
	private int pos;
	private int next;
	
	public Node(Buffer buf, int posi){
		pageNum = buf.getInt(posi);
		this.pos = buf.getInt(posi+INT_SIZE);
		this.next = buf.getInt(posi+INT_SIZE*2);
	}
	
	public Node(int pageNum, int pos, int next){
		this.pageNum = pageNum;
		this.pos = pos;
		this.next = next;
	}
	
	public int pageNum(){ return this.pageNum; }
	public int pos(){  return this.pos;  }
	public int next(){  return this.next;  }
	public RID rid(){  return new RID(this.pageNum, this.pos); }
	
}
